package com.sk.ccflower.server.profile;

import org.apache.log4j.Logger;

import com.sk.ccflower.lib.define.BaseCfg;
import com.sk.ccflower.server.lib.dbUtils.ConnectionPoolManager;
import com.sk.ccflower.server.lib.sysUtils.BaseMain;
import com.sk.ccflower.server.profile.xmlrpc.ThumbnailQueueThread;

public class ProfileCenter extends BaseMain {
	
	private Logger m_log = null;
	public ConnectionPoolManager connectionPool = null;
	
	public ProfileCenter() throws Exception {
		super();
		
		this.m_log = Logger.getLogger( getClass() );
	}
	
	public static void main( String[] args ) {
		ProfileCenter main = null;
		try {
			main = new ProfileCenter();
			main.init();
			main.start();
		} catch (Exception e) {
			System.out.println(e.toString());
		}
	}
	
	private void init() {
		connectionPool = ConnectionPoolManager.getInstance(BaseCfg.JDBC_URL, BaseCfg.JDBC_USER, BaseCfg.JDBC_PWD);
	}
	
	private void start() {
		System.out.println( "ProfileCenter start..." );
		try {
			ThumbnailQueueThread tThread = new ThumbnailQueueThread( this );
			tThread.start();
			
			while ( true ) {
				Thread.sleep( 1000 );
			}
		} catch ( Exception e ) {
			this.m_log.error( e );
			e.printStackTrace();
		}
	}
	
}
